<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import inter from '@/utils/interceptor'
import { guanzhuStore, myStore } from '@/stores'
import { ref } from "vue";
const user = myStore()
const xToken = ref<string | null>(null);
const StatusBar = ref<number>(0);
const CustomBar = ref<number>(0);
const Custom = ref<any>(null);
onLaunch(() => {
  console.log('App Launch')
  // // 这里设置判断是否token，如果有就直接进入，没有跳转到登录页进行登录

  if (!user.userinfo) {
    console.log('经过了')

    uni.showModal({
      title: '提示',
      content: '请先登录才能操作其他',
      success: (res) => {
        if (res.confirm) {
          uni.navigateTo({
            url: '/pages/login/login',
          })
        }
      },
    })
    return
  }
  inter()
})
onShow(() => {
  console.log('App Show')
})
onHide(() => {
  console.log('App Hide')
})
</script>

<style lang="scss">
// 字体图标
@import '../src/styles/fonts';
@import '../src/styles/main';
// 图标icon
@import '../src/styles/icon';
/* uniApp官方样式 */
@import './components/uni.css';
// 全局所有css
@import './components/free.css';
@import './components/vk-uview-ui_1.5.2/theme.scss';
@import './components/vk-uview-ui_1.5.2/index.scss';

view,
navigator,
input,
scroll-view {
  box-sizing: border-box;
}

button::after {
  border: none;
}

swiper,
scroll-view {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

image {
  width: 100%;
  height: 100%;
  vertical-align: middle;
}

// 两行省略
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>
